﻿using System;
using System.Net;

namespace SilverlightClientLibrary.Messages
{
    public abstract class Message
    {
        public byte IdOfSender { get; protected set; }
        public int BufferSize { get; private set; }

        public Message(int bufferSize)
        {
            BufferSize = bufferSize;
        }

        public void DecodeIdOfSender(byte[] buffer)
        {
            IdOfSender = buffer[1];
        }
        public abstract byte[] Encode();
        public abstract Message Decode(byte[] bytes);
    }
}
